import {
  tempSourceOptions,
  // subjectOptions,
  authorNature,
  authorRegion,
  authorCostMode,
  settlePeriodOptions,
  // cooperModeOptions,
  contractTypeOptions,
  cooperNatureOption,
  eCommerceAccountPeriod,
  investBusinessType,
  writType,
  // investSubjectOptions,
  // ipSubjectOptions,
  // ecommerceSubjectOption,
  eCooperModeOptions,
  sureOption,
  propertyOwnerOption,
  existOption,
  stampTypeOption,
  autoRenewalOption
} from '../../module/options';
import { cooperationOption } from '@/utils/accountCommonData';

export const weMediaLegalConstruct = function(arg = {}) {
  return [{
    title: '基本信息',
    titleStyle: {
      'margin-bottom': '19px'
    },
    children: [[{
      label: '申请人',
      type: 'prePersonSelect',
      placeholder: '请选择申请人',
      required: true,
      key: 'proposer',
      module: 'createInfo',
      marginRight: '41px',
      showCheckUser: true,
      selectKeyName: 'id',
      selectLabelName: 'userName',
      defaultList: [],
      disabled: arg['disabled'] ? arg['disabled'].includes('proposer') : false
    }, {
      label: '申请人部门',
      type: 'preDeptSelect',
      placeholder: '请选择部门',
      required: true,
      key: 'departmentId',
      module: 'createInfo',
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'value',
      disabled: arg['disabled'] ? arg['disabled'].includes('departmentId') : false
    }, {
      label: '申请人职位',
      type: 'preInput',
      placeholder: '请输入职位',
      required: true,
      key: 'post',
      maxlength: 16,
      module: 'createInfo',
      marginRight: '41px',
      disabled: arg['disabled'] ? arg['disabled'].includes('post') : false
    }]],
    key: 'createInfo'
  }, {
    title: '合同信息',
    titleStyle: {
      'margin-bottom': '18px'
    },
    children: [[{
      label: '合同类型',
      type: 'legalTypeText',
      // type: 'preText',
      key: 'type',
      module: 'contractInfo'
    }, {
      label: '项目名称',
      type: 'input',
      key: 'name',
      maxlength: 16,
      placeholder: '请输入项目名称',
      module: 'contractInfo'
    }], [{
      label: '合同模板来源',
      type: 'select',
      key: 'tempSource',
      placeholder: '请选择合同模板来源',
      labelWidth: '115px',
      module: 'contractInfo',
      option: tempSourceOptions
    }, {
      label: '我方签约主体',
      type: 'select',
      key: 'subject',
      placeholder: '请选择我方签约主体',
      module: 'contractInfo',
      labelWidth: '115px',
      option: []
    }, {
      label: '签约对方',
      key: 'oppCompany',
      module: 'contractInfo',
      type: 'searchOption',
      placeholder: '请选择申请人',
      required: true,
      selectKeyName: 'uuid',
      selectLabelName: 'name',
      defaultList: [],
      addNew: true,
      loadmore: false,
      selectTypeName: 'type'
    }, {
      label: '销售折扣/返利',
      type: 'radio',
      key: 'rebates',
      module: 'contractInfo',
      showContractType: 2, // 仅推广销售类显示
      option: existOption
    }], [{
      label: '销售折扣/返利',
      type: 'radio',
      key: 'rebates',
      module: 'contractInfo',
      showContractType: 3, // 仅渠道采买类显示
      option: existOption
    }], [{
      label: '上游合同签订',
      type: 'radio',
      key: 'upstreamSign',
      module: 'contractInfo',
      showContractType: 3, // 仅渠道采买类显示
      option: sureOption
    }], [{
      label: '上游付款情况',
      type: 'radio',
      key: 'upstreamPay',
      module: 'contractInfo',
      showContractType: 3, // 仅渠道采买类显示
      option: sureOption
    }], [{
      label: '上游知识产权情况',
      type: 'radio',
      key: 'propertyOwner',
      module: 'contractInfo',
      showContractType: 3, // 仅渠道采买类显示
      option: propertyOwnerOption
    }], [{
      label: '使用法务的模板且未修改',
      type: 'radio',
      key: 'legalTemplate',
      module: 'contractInfo',
      option: sureOption,
      showTip: 'true',
      tip: '<div>当选择“是”：必须使用公司提供的合同模板，<span>注意不可修改模板内容！</span>可从合同模板下载法务上传的文档；使用合同模板可跳过法务审批节点，加快合同审批速度；</div>'
    }], [{
      label: '仅我方盖章',
      type: 'radio',
      key: 'ourStamp',
      module: 'contractInfo',
      option: sureOption,
      showTip: true,
      tip: '当合同仅需我方盖章，无需对方盖章，请选择“是”'
    }], [{
      label: '盖章类型',
      type: 'radio',
      key: 'stampType',
      module: 'contractInfo',
      option: stampTypeOption
      // isFillLine: true
    }], [{
      label: '我方是否垫款',
      type: 'radio',
      key: 'payAdvance',
      module: 'contractInfo',
      showContractType: 3, // 仅渠道采买类显示
      option: sureOption
    }], [{
      label: '合同日期',
      type: 'legalDate',
      key: 'date',
      module: 'contractInfo',
      isFillLine: true
    }], [{
      label: '应收合同金额(元)',
      type: 'input',
      status: 'number',
      key: 'receivableAmount',
      module: 'contractInfo',
      showContractType: 2,
      isFillLine: true,
      placeholder: '请输入应收合同金额',
      showTip: true,
      tip: '请填写合同实际的应收金额，用于注明合同本身的实际流水收支情况'
    }], [{
      label: '应付合同金额(元)',
      type: 'input',
      status: 'number',
      key: 'payableAmount',
      module: 'contractInfo',
      showContractType: 3,
      isFillLine: true,
      placeholder: '请输入应付合同金额',
      showTip: true,
      tip: '请填写合同实际的应付金额，用于注明合同本身的实际流水收支情况'
    }], [{
      label: '合同说明及合作内容',
      type: 'textarea',
      key: 'describe',
      module: 'contractInfo',
      maxlength: 2000,
      placeholder: '提示：哪些条款客户要求调整？对方模板中我方业务执行不可接受的条款？特殊事项要求？其他需要告知法务财务的背景条件？',
      isFillLine: true
    }], [{
      label: '合同附件',
      type: 'fileUpload',
      key: 'attachment',
      module: 'contractInfo',
      importApi: '/admin/contract/file/upload',
      btnTxt: '上传附件',
      limitFileNum: 10,
      isFlexStart: true,
      isFillLine: true
    }]]
  }];
};

export const ipAccreditLegalConstruct = function(arg = {}) {
  return [{
    title: '基本信息',
    titleStyle: {
      'margin-bottom': '19px'
    },
    children: [[{
      label: '申请人',
      type: 'prePersonSelect',
      placeholder: '请选择申请人',
      required: true,
      key: 'proposer',
      module: 'createInfo',
      marginRight: '41px',
      showCheckUser: true,
      selectKeyName: 'id',
      selectLabelName: 'userName',
      defaultList: [],
      disabled: arg['disabled'] ? arg['disabled'].includes('proposer') : false
    }, {
      label: '申请人部门',
      type: 'preDeptSelect',
      placeholder: '请选择部门',
      required: true,
      key: 'departmentId',
      module: 'createInfo',
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'value',
      disabled: arg['disabled'] ? arg['disabled'].includes('departmentId') : false
    }, {
      label: '申请人职位',
      type: 'preInput',
      placeholder: '请输入职位',
      required: true,
      key: 'post',
      maxlength: 16,
      module: 'createInfo',
      marginRight: '41px',
      disabled: arg['disabled'] ? arg['disabled'].includes('post') : false
    }]],
    key: 'createInfo'
  }, {
    title: '合同信息',
    titleStyle: {
      'margin-bottom': '18px'
    },
    children: [[{
      label: '合同类型',
      type: 'legalTypeText',
      key: 'type',
      module: 'contractInfo'
    }, {
      label: '项目名称',
      type: 'input',
      key: 'name',
      maxlength: 16,
      placeholder: '请输入项目名称',
      module: 'contractInfo'
    }], [{
      label: '合同模板来源',
      type: 'select',
      key: 'tempSource',
      placeholder: '请选择合同模板来源',
      labelWidth: '115px',
      module: 'contractInfo',
      option: tempSourceOptions
    }, {
      label: '我方签约主体',
      type: 'select',
      key: 'subject',
      placeholder: '请选择我方签约主体',
      labelWidth: '115px',
      module: 'contractInfo',
      option: []
    }, {
      label: '签约对方',
      key: 'oppCompany',
      module: 'contractInfo',
      type: 'searchOption',
      placeholder: '请选择申请人',
      required: true,
      selectKeyName: 'uuid',
      selectLabelName: 'name',
      defaultList: [],
      addNew: true,
      loadmore: false,
      selectTypeName: 'type',
      lineFeed: true
    }], [{
      label: '使用法务的模板且未修改',
      type: 'radio',
      key: 'legalTemplate',
      module: 'contractInfo',
      option: sureOption,
      showTip: 'true',
      tip: '<div>当选择“是”：必须使用公司提供的合同模板，<span>注意不可修改模板内容！</span>可从合同模板下载法务上传的文档；使用合同模板可跳过法务审批节点，加快合同审批速度；</div>'
    }], [{
      label: '仅我方盖章',
      type: 'radio',
      key: 'ourStamp',
      module: 'contractInfo',
      option: sureOption,
      showTip: true,
      tip: '当合同仅需我方盖章，无需对方盖章，请选择“是”'
    }], [{
      label: '盖章类型',
      type: 'radio',
      key: 'stampType',
      module: 'contractInfo',
      option: stampTypeOption
    }], [{
      label: '合同说明及合作内容',
      type: 'textarea',
      key: 'describe',
      module: 'contractInfo',
      maxlength: 2000,
      placeholder: '提示：哪些条款客户要求调整？对方模板中我方业务执行不可接受的条款？特殊事项要求？其他需要告知法务财务的背景条件？',
      isFillLine: true
    }], [{
      label: '合同附件',
      type: 'fileUpload',
      key: 'attachment',
      module: 'contractInfo',
      importApi: '/admin/contract/file/upload',
      btnTxt: '上传附件',
      limitFileNum: 10,
      isFillLine: true
    }]]
  }, {
    title: '授权单信息',
    titleStyle: {
      'margin-bottom': '18px'
    },
    children: [[{
      label: 'IP形象/授权内容',
      type: 'input',
      key: 'content',
      placeholder: '请输入IP形象/授权内容',
      module: 'authorBillInfo',
      maxlength: 64
    }, {
      label: '授权领域',
      type: 'input',
      key: 'territory',
      placeholder: '请输入授权领域',
      module: 'authorBillInfo',
      maxlength: 64
    }, {
      label: '授权商品品类/授权形式',
      type: 'input',
      key: 'modality',
      placeholder: '请输入授权商品品类/授权形式',
      module: 'authorBillInfo',
      maxlength: 64
    }], [{
      label: '授权性质',
      type: 'select',
      key: 'nature',
      placeholder: '请选择授权性质',
      module: 'authorBillInfo',
      option: authorNature
    }, {
      label: '授权区域',
      type: 'select',
      key: 'region',
      placeholder: '请选择授权区域',
      module: 'authorBillInfo',
      option: authorRegion
    }, {
      label: '授权总金额(元)',
      type: 'input',
      status: 'number',
      key: 'totalMoney',
      placeholder: '请输入授权总金额',
      module: 'authorBillInfo'
    }], [{
      label: '授权分成模式',
      type: 'select',
      key: 'costMode',
      placeholder: '请选择授权分成模式',
      module: 'authorBillInfo',
      option: authorCostMode
    }, {
      label: '授权期限/期数',
      type: 'deadlineSelect',
      key: 'deadline',
      placeholder: '请填写完整',
      module: 'authorBillInfo'
    }], [{
      label: '付款期限',
      type: 'autorPayDeadline',
      key: 'payDeadline',
      module: 'authorBillInfo',
      isFillLine: true
    }]]
  }];
};

/* [{
  label: '创建人',
  type: 'preText',
  key: 'creater',
  module: 'createInfo'
}, {
  label: '创建人部门',
  type: 'preText',
  key: 'createrDepartment',
  module: 'createInfo'
}, {
  label: '创建人职位',
  type: 'preText',
  key: 'createrPost',
  module: 'createInfo'
}] */
export const staffAdministrationLegalConstruct = function(arg = {}) {
  return [{
    title: '基本信息',
    titleStyle: {
      'margin-bottom': '19px'
    },
    children: [[{
      label: '申请人',
      type: 'prePersonSelect',
      placeholder: '请选择申请人',
      required: true,
      key: 'proposer',
      module: 'createInfo',
      showCheckUser: true,
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'userName',
      defaultList: [],
      disabled: arg['disabled'] ? arg['disabled'].includes('proposer') : false
    }, {
      label: '申请人部门',
      type: 'preDeptSelect',
      placeholder: '请选择部门',
      required: true,
      key: 'departmentId',
      module: 'createInfo',
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'value',
      disabled: arg['disabled'] ? arg['disabled'].includes('departmentId') : false
    }, {
      label: '申请人职位',
      type: 'preInput',
      placeholder: '请输入职位',
      required: true,
      key: 'post',
      maxlength: 16,
      module: 'createInfo',
      marginRight: '41px',
      disabled: arg['disabled'] ? arg['disabled'].includes('post') : false
    }]],
    key: 'createInfo'
  }, {
    title: '合同信息',
    titleStyle: {
      'margin-bottom': '18px'
    },
    children: [[{
      label: '合同类型',
      type: 'legalTypeText',
      key: 'type',
      module: 'contractInfo'
    }, {
      label: '项目名称',
      type: 'input',
      key: 'name',
      maxlength: 16,
      placeholder: '请输入项目名称',
      module: 'contractInfo'
    }], [{
      label: '合同模板来源',
      type: 'select',
      key: 'tempSource',
      placeholder: '请选择合同模板来源',
      labelWidth: '115px',
      module: 'contractInfo',
      option: tempSourceOptions
    }, {
      label: '我方签约主体',
      type: 'select',
      key: 'subject',
      placeholder: '请选择我方签约主体',
      labelWidth: '115px',
      module: 'contractInfo',
      option: []
    }, {
      label: '签约对方',
      type: 'oppCompanySelect',
      key: 'oppCompany',
      maxlength: 64,
      placeholder: '请输入签约对方',
      module: 'contractInfo',
      showAllSupplier: true,
      required: true,
      lineFeed: true
    }], [{
      label: '使用法务的模板且未修改',
      type: 'radio',
      key: 'legalTemplate',
      module: 'contractInfo',
      option: sureOption,
      showTip: 'true',
      tip: '<div>当选择“是”：必须使用公司提供的合同模板，<span>注意不可修改模板内容！</span>可从合同模板下载法务上传的文档；使用合同模板可跳过法务审批节点，加快合同审批速度；</div>'
    }], [{
      label: '仅我方盖章',
      type: 'radio',
      key: 'ourStamp',
      module: 'contractInfo',
      option: sureOption,
      showTip: true,
      tip: '当合同仅需我方盖章，无需对方盖章，请选择“是”'
    }], [{
      label: '盖章类型',
      type: 'radio',
      key: 'stampType',
      module: 'contractInfo',
      option: stampTypeOption
    }], [{
      label: '合作日期/付款方式',
      type: 'staffAdminCooperDate',
      key: 'cooperDate',
      module: 'contractInfo',
      isFillLine: true
    }], [{
      label: '合同说明及合作内容',
      type: 'textarea',
      key: 'describe',
      module: 'contractInfo',
      maxlength: 2000,
      placeholder: '提示：哪些条款客户要求调整？对方模板中我方业务执行不可接受的条款？特殊事项要求？其他需要告知法务财务的背景条件？是否采买特殊物件？是否有物品时效/保质期/质量/运费等特殊要求？',
      isFillLine: true
    }], [{
      label: '合同附件',
      type: 'fileUpload',
      key: 'attachment',
      module: 'contractInfo',
      importApi: '/admin/contract/file/upload',
      btnTxt: '上传附件',
      limitFileNum: 10,
      isFillLine: true
    }]]
  }];
};

export const kolLegalConstruct = function(arg = {}) {
  return [{
    title: '基本信息',
    titleStyle: {
      'margin-bottom': '19px'
    },
    children: [[{
      label: '申请人',
      type: 'prePersonSelect',
      placeholder: '请选择申请人',
      required: true,
      key: 'proposer',
      module: 'createInfo',
      showCheckUser: true,
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'userName',
      defaultList: [],
      disabled: arg['disabled'] ? arg['disabled'].includes('proposer') : false
    }, {
      label: '申请人部门',
      type: 'preDeptSelect',
      placeholder: '请选择部门',
      required: true,
      key: 'departmentId',
      module: 'createInfo',
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'value',
      disabled: arg['disabled'] ? arg['disabled'].includes('departmentId') : false
    }, {
      label: '申请人职位',
      type: 'preInput',
      placeholder: '请输入职位',
      required: true,
      key: 'post',
      maxlength: 16,
      module: 'createInfo',
      marginRight: '41px',
      disabled: arg['disabled'] ? arg['disabled'].includes('post') : false
    }]],
    key: 'createInfo'
  }, {
    title: '合同信息',
    titleStyle: {
      'margin-bottom': '18px'
    },
    children: [[{
      label: '合同类型',
      type: 'legalTypeText',
      key: 'type',
      module: 'contractInfo'
    }, {
      label: '项目名称',
      type: 'input',
      key: 'name',
      maxlength: 16,
      placeholder: '请输入项目名称',
      module: 'contractInfo'
    }], [{
      label: '合同模板来源',
      type: 'select',
      key: 'tempSource',
      placeholder: '请选择合同模板来源',
      labelWidth: '115px',
      module: 'contractInfo',
      option: tempSourceOptions
    }, {
      label: '我方签约主体',
      type: 'select',
      key: 'subject',
      placeholder: '请选择我方签约主体',
      labelWidth: '115px',
      module: 'contractInfo',
      option: []
    }], [{
      label: '签约对方',
      type: 'oppCompanySelect',
      key: 'oppCompany',
      maxlength: 64,
      placeholder: '请输入签约对方',
      showAllSupplier: true,
      module: 'contractInfo',
      required: true,
      lineFeed: true
    }], [{
      label: '销售折扣/返利',
      type: 'radio',
      key: 'rebates',
      module: 'contractInfo',
      showContractType: 5, // 仅推广销售类显示
      option: existOption
    }], [{
      label: '合同期限',
      type: 'dateRangeTime',
      key: 'deadline',
      maxlength: 64,
      module: 'contractInfo',
      tip: '合同起止时间'
    }, {
      label: '结算周期',
      type: 'otherSelectGroup',
      key: 'accountPeriod',
      module: 'contractInfo',
      typeField: 'type',
      nameField: 'name',
      options: settlePeriodOptions,
      otherValue: 4,
      typePlaceholder: '请选择',
      namePlaceholder: '周期',
      nameType: 'number'
    }], [{
      label: '自动续约',
      type: 'select',
      key: 'autoRenewal',
      module: 'contractInfo',
      placeholder: '请选择',
      option: autoRenewalOption
    }], [{
      label: '使用法务的模板且未修改',
      type: 'radio',
      key: 'legalTemplate',
      module: 'contractInfo',
      option: sureOption,
      showTip: 'true',
      tip: '<div>当选择“是”：必须使用公司提供的合同模板，<span>注意不可修改模板内容！</span>可从合同模板下载法务上传的文档；使用合同模板可跳过法务审批节点，加快合同审批速度；</div>'
    }], [{
      label: '仅我方盖章',
      type: 'radio',
      key: 'ourStamp',
      module: 'contractInfo',
      option: sureOption,
      showTip: true,
      tip: '当合同仅需我方盖章，无需对方盖章，请选择“是”'
    }], [{
      label: '盖章类型',
      type: 'radio',
      key: 'stampType',
      module: 'contractInfo',
      option: stampTypeOption
    }],
    // [{
    //   label: '合作模式',
    //   type: 'otherSelectGroup',
    //   key: 'cooperModel',
    //   module: 'contractInfo',
    //   typeField: 'type',
    //   nameField: 'name',
    //   options: cooperModeOptions,
    //   otherValue: 3,
    //   typePlaceholder: '请选择',
    //   namePlaceholder: '合作模式',
    //   nameType: 'string'
    // }, {
    //   label: '合作性质',
    //   type: 'select',
    //   key: 'cooperNature',
    //   placeholder: '请选择合作性质',
    //   module: 'contractInfo',
    //   option: cooperNatureOption
    // }],
    [{
      label: '合同类别',
      type: 'select',
      key: 'contractType',
      module: 'contractInfo',
      placeholder: '请选择合同类别',
      option: contractTypeOptions
    }], [{
      label: '合作方式',
      type: 'select',
      key: 'cooperationMode',
      module: 'contractInfo',
      placeholder: '请选择合作方式',
      option: cooperationOption
    }], [{
      label: '公司分成比例',
      type: 'companyRatioInput',
      key: 'profitSharingRatio',
      module: 'contractInfo',
      complementaryKey: 'talentSharingRatio',
      placeholder: '请输入公司分成比例'
    }], [{
      label: '达人分成比例',
      type: 'talentRatioInput',
      key: 'talentSharingRatio',
      module: 'contractInfo',
      placeholder: '达人分成比例',
      disabled: true
    }], [{
      label: '保底金额(元)',
      type: 'input',
      status: 'number',
      key: 'guaranteePrice',
      placeholder: '请输入保底金额',
      module: 'contractInfo'
    }],
    // [{
    //   label: '合作平台/账号',
    //   type: 'cooperAccountSelect',
    //   key: 'cooperPlatforms',
    //   module: 'contractInfo',
    //   isFillLine: true
    // }],
    // [{
    //   label: '分成/收益',
    //   type: 'checkboxInputs',
    //   key: 'earnings',
    //   module: 'contractInfo',
    //   checkboxGroupField: 'earningTypes',
    //   inputItems: [{
    //     field: 'proportion',
    //     label: '分成比例',
    //     placeholder: '分成比例',
    //     tip: '提示：多平台分成比例不同，请注明好平台与分成比例',
    //     value: 1,
    //     type: 'number'
    //   }, {
    //     field: 'guaranteeSum',
    //     label: '保底金额',
    //     placeholder: '保底金额',
    //     value: 2,
    //     type: 'number'
    //   }],
    //   isFillLine: true
    // }],
    [{
      label: 'GMV分成比例',
      type: 'GMVRate',
      key: 'gmvRate',
      module: 'contractInfo',
      placeholder: 'GMV分成比例和公司分成比例都必填，若合同里没有该项目请填写0',
      isFillLine: true
    }],
    [{
      label: '合同说明及合作内容',
      type: 'textarea',
      key: 'describe',
      module: 'contractInfo',
      maxlength: 2000,
      placeholder: '提示：哪些条款需要调整？对方模板中我方业务执行不可接受的条款？其他需要告知法务财务的背景条件？对方是否允许修改合同？',
      isFillLine: true
    }], [{
      label: '合同附件',
      type: 'fileUpload',
      key: 'attachment',
      module: 'contractInfo',
      importApi: '/admin/contract/file/upload',
      btnTxt: '上传附件',
      limitFileNum: 10,
      isFillLine: true
    }], [{
      label: '特殊约定',
      type: 'textarea',
      key: 'otherDec',
      module: 'contractInfo',
      maxlength: 2000,
      placeholder: '提示：是否特殊的合作条件等',
      isFillLine: true
    }]]
  }];
};

export const platformLegalConstruct = function(arg = {}) {
  return [{
    title: '基本信息',
    titleStyle: {
      'margin-bottom': '19px'
    },
    children: [[{
      label: '申请人',
      type: 'prePersonSelect',
      placeholder: '请选择申请人',
      required: true,
      key: 'proposer',
      module: 'createInfo',
      showCheckUser: true,
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'userName',
      defaultList: [],
      disabled: arg['disabled'] ? arg['disabled'].includes('proposer') : false
    }, {
      label: '申请人部门',
      type: 'preDeptSelect',
      placeholder: '请选择部门',
      required: true,
      key: 'departmentId',
      module: 'createInfo',
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'value',
      disabled: arg['disabled'] ? arg['disabled'].includes('departmentId') : false
    }, {
      label: '申请人职位',
      type: 'preInput',
      placeholder: '请输入职位',
      required: true,
      key: 'post',
      maxlength: 16,
      module: 'createInfo',
      marginRight: '41px',
      disabled: arg['disabled'] ? arg['disabled'].includes('post') : false
    }]],
    key: 'createInfo'
  }, {
    title: '合同信息',
    titleStyle: {
      'margin-bottom': '18px'
    },
    children: [[{
      label: '合同类型',
      type: 'legalTypeText',
      key: 'type',
      module: 'contractInfo'
    }, {
      label: '项目名称',
      type: 'input',
      key: 'name',
      maxlength: 16,
      placeholder: '请输入项目名称',
      module: 'contractInfo'
    }], [{
      label: '合同模板来源',
      type: 'select',
      key: 'tempSource',
      placeholder: '请选择合同模板来源',
      labelWidth: '115px',
      module: 'contractInfo',
      option: tempSourceOptions
    }, {
      label: '我方签约主体',
      type: 'select',
      key: 'subject',
      placeholder: '请选择我方签约主体',
      labelWidth: '115px',
      module: 'contractInfo',
      option: []
    }, {
      label: '签约对方',
      key: 'oppCompany',
      module: 'contractInfo',
      type: 'searchOption',
      placeholder: '请选择申请人',
      required: true,
      selectKeyName: 'uuid',
      selectLabelName: 'name',
      defaultList: [],
      addNew: true,
      loadmore: false,
      selectTypeName: 'type',
      lineFeed: true
    }], [{
      label: '合同期限',
      type: 'dateRangeTime',
      key: 'deadline',
      maxlength: 64,
      module: 'contractInfo',
      tip: '合同起止时间'
    }, {
      label: '结算周期',
      type: 'otherSelectGroup',
      key: 'accountPeriod',
      module: 'contractInfo',
      typeField: 'type',
      nameField: 'name',
      options: settlePeriodOptions,
      otherValue: 4,
      typePlaceholder: '请选择',
      namePlaceholder: '结算周期',
      nameType: 'number',
      maxlength: 12
    }], [{
      label: '合作模式',
      type: 'input',
      key: 'cooperModelName',
      maxlength: 64,
      placeholder: '请输入具体内容',
      module: 'contractInfo'
    }, {
      label: '合作性质',
      type: 'select',
      key: 'cooperNature',
      placeholder: '请选择',
      module: 'contractInfo',
      option: cooperNatureOption
    }], [{
      label: '收益模式',
      type: 'input',
      key: 'earningModel',
      maxlength: 64,
      placeholder: '请输入具体内容',
      module: 'contractInfo'
    }, {
      label: '合作地域',
      type: 'input',
      key: 'cooperRegion',
      maxlength: 64,
      placeholder: '请输入合作地域',
      tip: '提示：如全球、中国大陆、海外等',
      module: 'contractInfo'
    }], [{
      label: '使用法务的模板且未修改',
      type: 'radio',
      key: 'legalTemplate',
      module: 'contractInfo',
      option: sureOption,
      showTip: 'true',
      tip: '<div>当选择“是”：必须使用公司提供的合同模板，<span>注意不可修改模板内容！</span>可从合同模板下载法务上传的文档；使用合同模板可跳过法务审批节点，加快合同审批速度；</div>'
    }], [{
      label: '仅我方盖章',
      type: 'radio',
      key: 'ourStamp',
      module: 'contractInfo',
      option: sureOption,
      showTip: true,
      tip: '当合同仅需我方盖章，无需对方盖章，请选择“是”'
    }], [{
      label: '盖章类型',
      type: 'radio',
      key: 'stampType',
      module: 'contractInfo',
      option: stampTypeOption
    }], [{
      label: '合作平台/账号',
      type: 'cooperAccountSelect',
      key: 'cooperPlatforms',
      module: 'contractInfo',
      isFillLine: true
    }], [{
      label: '合同说明及合作内容',
      type: 'textarea',
      key: 'describe',
      module: 'contractInfo',
      maxlength: 2000,
      placeholder: '提示：更为具体的合作内容？哪些条款需要调整？对方模板中我方业务执行不可接受的条款？其他需要告知财务的背景条件？对方是否允许修改合同？',
      isFillLine: true
    }], [{
      label: '合同附件',
      type: 'fileUpload',
      key: 'attachment',
      module: 'contractInfo',
      importApi: '/admin/contract/file/upload',
      btnTxt: '上传附件',
      limitFileNum: 10,
      isFillLine: true
    }], [{
      label: '特殊约定',
      type: 'textarea',
      key: 'otherDec',
      module: 'contractInfo',
      maxlength: 2000,
      placeholder: '提示：特殊的合作条件等',
      isFillLine: true
    }]]
  }];
};

export const eCommerceLegalConstruct = function(arg = {}) {
  return [{
    title: '基本信息',
    titleStyle: { 'margin-bottom': '19px' },
    children: [[{
      label: '申请人',
      type: 'prePersonSelect',
      placeholder: '请选择申请人',
      required: true,
      key: 'proposer',
      module: 'createInfo',
      showCheckUser: true,
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'userName',
      defaultList: [],
      disabled: arg['disabled'] ? arg['disabled'].includes('proposer') : false
    }, {
      label: '申请人部门',
      type: 'preDeptSelect',
      placeholder: '请选择部门',
      required: true,
      key: 'departmentId',
      module: 'createInfo',
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'value',
      disabled: arg['disabled'] ? arg['disabled'].includes('departmentId') : false
    }, {
      label: '申请人职位',
      type: 'preInput',
      placeholder: '请输入职位',
      required: true,
      key: 'post',
      maxlength: 16,
      module: 'createInfo',
      marginRight: '41px',
      disabled: arg['disabled'] ? arg['disabled'].includes('post') : false
    }]],
    key: 'createInfo'
  }, {
    title: '合同信息',
    titleStyle: { 'margin-bottom': '18px' },
    children: [
      [{
        label: '合同类型',
        type: 'legalTypeText',
        key: 'type',
        module: 'contractInfo'
      }, {
        label: '项目名称',
        type: 'input',
        key: 'name',
        maxlength: 16,
        placeholder: '请输入项目名称',
        module: 'contractInfo'
      }], [{
        label: '合同模板来源',
        type: 'select',
        key: 'tempSource',
        placeholder: '请选择合同模板来源',
        module: 'contractInfo',
        option: tempSourceOptions
      }, {
        label: '我方签约主体',
        type: 'select',
        key: 'subject',
        placeholder: '请选择我方签约主体',
        module: 'contractInfo',
        option: []
      }, {
        label: '签约对方',
        key: 'oppCompany',
        module: 'contractInfo',
        type: 'searchOption',
        placeholder: '请选择申请人',
        required: true,
        selectKeyName: 'uuid',
        selectLabelName: 'name',
        defaultList: [],
        addNew: true,
        loadmore: false,
        selectTypeName: 'type',
        isECommerce: true,
        lineFeed: true
      }], [{
        label: '银行账号',
        type: 'input',
        key: 'accountNumber',
        maxlength: 50,
        onlyNumber: true,
        placeholder: '请输入对方公司银行账号',
        module: 'contractInfo'
      }, {
        label: '户名',
        type: 'input',
        key: 'accountName',
        maxlength: 50,
        placeholder: '请输入对方公司户名',
        module: 'contractInfo'
      }, {
        label: '对方开户行',
        type: 'input',
        key: 'depositBank',
        maxlength: 50,
        placeholder: '请输入对方开户行',
        labelWidth: '115px',
        module: 'contractInfo'
      }, {
        label: '对方联系人',
        type: 'input',
        key: 'contactPerson',
        maxlength: 50,
        placeholder: '请输入对方公司联系人',
        module: 'contractInfo'
      }, {
        label: '联系人电话',
        type: 'input',
        key: 'contactPhone',
        maxlength: 50,
        placeholder: '请输入对方公司联系人电话',
        module: 'contractInfo'
      }, {
        label: '供应商地址',
        type: 'input',
        key: 'supplierAddress',
        placeholder: '请输入供应商详细地址',
        maxlength: 50,
        module: 'contractInfo'
      }, {
        label: '合作模式',
        type: 'otherSelectGroup',
        key: 'cooperModel',
        module: 'contractInfo',
        typeField: 'type',
        nameField: 'name',
        options: eCooperModeOptions,
        otherValue: -1,
        typePlaceholder: '请选择',
        namePlaceholder: '请输入合作模式',
        nameType: 'string'
      }],
      [{
        label: '合作期限',
        type: 'dateRangeTime',
        key: 'deadline',
        maxlength: 64,
        module: 'contractInfo'
      }, {
        label: '结算周期',
        type: 'otherSelectGroup',
        key: 'accountPeriod',
        module: 'contractInfo',
        typeField: 'type',
        nameField: 'name',
        options: eCommerceAccountPeriod,
        otherValue: 1,
        typePlaceholder: '请选择',
        namePlaceholder: '付款进度及时间',
        isFlexStart: true,
        nameType: 'string'
      }], [{
        label: '使用法务的模板且未修改',
        type: 'radio',
        key: 'legalTemplate',
        module: 'contractInfo',
        option: sureOption,
        showTip: 'true',
        tip: '<div>当选择“是”：必须使用公司提供的合同模板，<span>注意不可修改模板内容！</span>可从合同模板下载法务上传的文档；使用合同模板可跳过法务审批节点，加快合同审批速度；</div>'
      }], [{
        label: '仅我方盖章',
        type: 'radio',
        key: 'ourStamp',
        module: 'contractInfo',
        option: sureOption,
        showTip: true,
        tip: '当合同仅需我方盖章，无需对方盖章，请选择“是”'
      }], [{
        label: '盖章类型',
        type: 'radio',
        key: 'stampType',
        module: 'contractInfo',
        option: stampTypeOption
      }], [{
        label: '合同说明及合作内容',
        type: 'textarea',
        key: 'describe',
        module: 'contractInfo',
        maxlength: 2000,
        placeholder: '提示：是否为我方模板无修改？如有修改，哪些条款要求调整？对方模板中我方业务执行不可接受的条款？特殊事项要求？其他需要告知法务财务的背景条件？',
        isFillLine: true
      }], [{
        label: '营业执照',
        type: 'fileUpload',
        key: 'businessLicense',
        module: 'contractInfo',
        importApi: '/admin/contract/file/upload',
        btnTxt: '上传附件',
        limitFileNum: 10,
        isFillLine: true
      }], [{
        label: '合同附件',
        type: 'fileUpload',
        key: 'attachment',
        module: 'contractInfo',
        importApi: '/admin/contract/file/upload',
        btnTxt: '上传附件',
        limitFileNum: 10,
        isFillLine: true
      }]
    ]
  }, {
    title: '商品信息/产品资质审批',
    titleStyle: { 'margin-bottom': '18px' },
    customBtn: true,
    children: [
      [{
        label: '',
        type: 'eCommerceGroup',
        key: '',
        module: 'merchandiseInfos',
        isFillLine: true
      }]
    ],
    key: 'merchandiseInfos'
  }];
};

export const investLegalConstruct = function(arg = {}) {
  return [{
    title: '基本信息',
    titleStyle: {
      'margin-bottom': '19px'
    },
    children: [[{
      label: '申请人',
      type: 'prePersonSelect',
      placeholder: '请选择申请人',
      required: true,
      key: 'proposer',
      module: 'createInfo',
      showCheckUser: true,
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'userName',
      defaultList: [],
      disabled: arg['disabled'] ? arg['disabled'].includes('proposer') : false
    }, {
      label: '申请人部门',
      type: 'preDeptSelect',
      placeholder: '请选择部门',
      required: true,
      key: 'departmentId',
      module: 'createInfo',
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'value',
      disabled: arg['disabled'] ? arg['disabled'].includes('departmentId') : false
    }, {
      label: '申请人职位',
      type: 'preInput',
      placeholder: '请输入职位',
      required: true,
      key: 'post',
      maxlength: 16,
      module: 'createInfo',
      marginRight: '41px',
      disabled: arg['disabled'] ? arg['disabled'].includes('post') : false
    }]],
    key: 'createInfo'
  }, {
    title: '合同信息',
    titleStyle: {
      'margin-bottom': '18px'
    },
    children: [[{
      label: '合同类型',
      type: 'legalTypeText',
      key: 'type',
      module: 'contractInfo'
    }, {
      label: '项目名称',
      type: 'input',
      key: 'name',
      maxlength: 16,
      placeholder: '请输入项目名称',
      module: 'contractInfo'
    }], [{
      label: '合同模板来源',
      type: 'select',
      key: 'tempSource',
      placeholder: '请选择合同模板来源',
      labelWidth: '115px',
      module: 'contractInfo',
      option: tempSourceOptions
    }, {
      label: '我方签约主体',
      type: 'select',
      key: 'subject',
      placeholder: '请选择我方签约主体',
      labelWidth: '115px',
      module: 'contractInfo',
      option: []
    }, {
      label: '签约对方',
      key: 'oppCompany',
      module: 'contractInfo',
      type: 'searchOption',
      placeholder: '请选择申请人',
      required: true,
      selectKeyName: 'uuid',
      selectLabelName: 'name',
      defaultList: [],
      addNew: true,
      loadmore: false,
      selectTypeName: 'type',
      lineFeed: true
    }], [{
      label: '签约日期',
      type: 'dateRangeTime',
      key: 'contractDate',
      module: 'contractInfo'
    }, {
      label: '业务类型',
      type: 'otherSelectGroup',
      key: 'businessType',
      module: 'contractInfo',
      typeField: 'type',
      nameField: 'name',
      options: investBusinessType,
      otherValue: 4,
      typePlaceholder: '请选择',
      namePlaceholder: '业务类型',
      nameType: 'string'
    }], [{
      label: '本轮估值金额(元)',
      type: 'input',
      status: 'number',
      key: 'appraisementAmount',
      maxlength: 16,
      placeholder: '请输入本轮估值金额',
      module: 'contractInfo'
    }, {
      label: '涉及金额(元)',
      type: 'input',
      status: 'number',
      key: 'involveAmount',
      placeholder: '请输入涉及金额',
      module: 'contractInfo'
    }, {
      label: '涉及金额对应股权比例',
      type: 'input',
      status: 'number',
      key: 'involveAmountStock',
      placeholder: '请输入股权比例',
      module: 'contractInfo'
    }], [{
      label: '工商变更登记时间',
      type: 'dateTime',
      key: 'aaumChangeDate',
      module: 'contractInfo'
    }], [{
      label: '使用法务的模板且未修改',
      type: 'radio',
      key: 'legalTemplate',
      module: 'contractInfo',
      option: sureOption,
      showTip: 'true',
      tip: '<div>当选择“是”：必须使用公司提供的合同模板，<span>注意不可修改模板内容！</span>可从合同模板下载法务上传的文档；使用合同模板可跳过法务审批节点，加快合同审批速度；</div>'
    }], [{
      label: '仅我方盖章',
      type: 'radio',
      key: 'ourStamp',
      module: 'contractInfo',
      option: sureOption,
      showTip: true,
      tip: '当合同仅需我方盖章，无需对方盖章，请选择“是”'
    }], [{
      label: '盖章类型',
      type: 'radio',
      key: 'stampType',
      module: 'contractInfo',
      option: stampTypeOption
    }], [{
      label: '付款日期',
      type: 'dateMulPicker',
      key: 'payDates',
      module: 'contractInfo',
      targetField: 'payDate',
      isFillLine: true
    }], [{
      label: '合同说明及合作内容',
      type: 'textarea',
      key: 'describe',
      module: 'contractInfo',
      maxlength: 2000,
      placeholder: '提示：哪些条款客户要求调整？对方模板中我方业务执行不可接受的条款？特殊事项要求？其他需要告知法务财务的背景条件？',
      isFillLine: true
    }], [{
      label: '合同附件',
      type: 'fileUpload',
      key: 'attachment',
      module: 'contractInfo',
      importApi: '/admin/contract/file/upload',
      btnTxt: '上传附件',
      limitFileNum: 10,
      isFillLine: true
    }]]
  }];
};

export const otherLegalConstruct = function(arg = {}) {
  return [{
    title: '基本信息',
    titleStyle: {
      'margin-bottom': '19px'
    },
    children: [[{
      label: '申请人',
      type: 'prePersonSelect',
      placeholder: '请选择申请人',
      required: true,
      key: 'proposer',
      module: 'createInfo',
      marginRight: '41px',
      showCheckUser: true,
      selectKeyName: 'id',
      selectLabelName: 'userName',
      defaultList: [],
      disabled: arg['disabled'] ? arg['disabled'].includes('proposer') : false
    }, {
      label: '申请人部门',
      type: 'preDeptSelect',
      placeholder: '请选择部门',
      required: true,
      key: 'departmentId',
      module: 'createInfo',
      marginRight: '41px',
      selectKeyName: 'id',
      selectLabelName: 'value',
      disabled: arg['disabled'] ? arg['disabled'].includes('departmentId') : false
    }, {
      label: '申请人职位',
      type: 'preInput',
      placeholder: '请输入职位',
      required: true,
      key: 'post',
      maxlength: 16,
      module: 'createInfo',
      marginRight: '41px',
      disabled: arg['disabled'] ? arg['disabled'].includes('post') : false
    }]],
    key: 'createInfo'
  }, {
    title: '合同信息',
    titleStyle: {
      'margin-bottom': '18px'
    },
    children: [[{
      label: '合同类型',
      type: 'legalTypeText',
      key: 'type',
      module: 'contractInfo'
    }, {
      label: '项目名称',
      type: 'input',
      key: 'name',
      maxlength: 16,
      placeholder: '请输入项目名称',
      module: 'contractInfo'
    }], [{
      label: '合同模板来源',
      type: 'select',
      key: 'tempSource',
      placeholder: '请选择合同模板来源',
      labelWidth: '115px',
      module: 'contractInfo',
      option: [...tempSourceOptions, {
        value: 4, label: '新拟定'
      }]
    }, {
      label: '我方签约主体',
      type: 'select',
      key: 'subject',
      placeholder: '请选择我方签约主体',
      labelWidth: '115px',
      module: 'contractInfo',
      option: []
    }, {
      label: '签约对方',
      key: 'oppCompany',
      module: 'contractInfo',
      type: 'searchOption',
      placeholder: '请选择申请人',
      required: true,
      selectKeyName: 'uuid',
      selectLabelName: 'name',
      defaultList: [],
      addNew: true,
      loadmore: false,
      selectTypeName: 'type'
    }], [{
      label: '合同/文书类型',
      type: 'otherSelectGroup',
      key: 'writType',
      module: 'contractInfo',
      typeField: 'type',
      nameField: 'name',
      options: writType,
      otherValue: 7,
      typePlaceholder: '请选择',
      namePlaceholder: '合同/文书类型',
      nameType: 'string'
    }], [{
      label: '使用法务的模板且未修改',
      type: 'radio',
      key: 'legalTemplate',
      module: 'contractInfo',
      option: sureOption,
      showTip: 'true',
      tip: '<div>当选择“是”：必须使用公司提供的合同模板，<span>注意不可修改模板内容！</span>可从合同模板下载法务上传的文档；使用合同模板可跳过法务审批节点，加快合同审批速度；</div>'
    }], [{
      label: '仅我方盖章',
      type: 'radio',
      key: 'ourStamp',
      module: 'contractInfo',
      option: sureOption,
      showTip: true,
      tip: '当合同仅需我方盖章，无需对方盖章，请选择“是”'
    }], [{
      label: '盖章类型',
      type: 'radio',
      key: 'stampType',
      module: 'contractInfo',
      option: stampTypeOption
    }], [{
      label: '涉及金额',
      type: 'moneyInvolved',
      key: 'moneyInvolved',
      module: 'contractInfo',
      isFillLine: true
    }], [{
      label: '合同说明及合作内容',
      type: 'textarea',
      key: 'describe',
      module: 'contractInfo',
      maxlength: 2000,
      placeholder: '提示：此类合同文书发起的业务背景介绍，哪些条款客户要求调整？对方模板中我方商务不可接受的条款？特殊事项要求？其他需要告知法务财务的背景条件？',
      isFillLine: true
    }], [{
      label: '合同附件',
      type: 'fileUpload',
      key: 'attachment',
      module: 'contractInfo',
      importApi: '/admin/contract/file/upload',
      btnTxt: '上传附件',
      limitFileNum: 10,
      isFillLine: true
    }], [{
      label: '特殊约定',
      type: 'textarea',
      key: 'otherDec',
      module: 'contractInfo',
      maxlength: 2000,
      placeholder: '提示：特殊的合作条件',
      isFillLine: true
    }]]
  }];
};

export const historyLegalConstruct = function(arg = {}) {
  return [{
    title: '合同信息',
    titleStyle: {
      'margin-bottom': '18px'
    },
    children: [[{
      label: '合同编号',
      type: 'input',
      key: 'code',
      maxlength: 64,
      module: 'contractInfo',
      placeholder: '请输入合同编号'
    }, {
      label: '合同日期',
      type: 'dateRangeTime',
      key: 'dateRange',
      module: 'contractInfo'
    }, {
      /* label: '签约对方',
      type: 'input',
      key: 'oppCompany',
      maxlength: 64,
      module: 'contractInfo',
      placeholder: '请输入签约对方' */
      label: '签约对方',
      key: 'oppCompany',
      module: 'contractInfo',
      type: 'searchOption',
      placeholder: '请选择申请人',
      required: true,
      selectKeyName: 'uuid',
      selectLabelName: 'name',
      defaultList: [],
      addNew: true,
      loadmore: false,
      selectTypeName: 'type'
    }], [{
      label: '项目名称',
      type: 'input',
      maxlength: 64,
      key: 'projectName',
      module: 'contractInfo',
      placeholder: '请输入项目名称'
    }, {
      label: '合同金额(元)',
      type: 'input',
      status: 'number',
      key: 'amount',
      module: 'contractInfo',
      placeholder: '请输入合同金额'
    }, {
      label: '是否年框',
      type: 'select',
      key: 'isYearFrame',
      placeholder: '请选择是否年框',
      module: 'contractInfo',
      option: [{
        value: 0,
        label: '否'
      }, {
        value: 1,
        label: '是'
      }]
    }], [
      {
        label: '执行日期',
        type: 'dateTime',
        key: 'executeDate',
        module: 'contractInfo'
      },
      {
        label: '合同签订时间',
        type: 'dateTime',
        key: 'signDate',
        module: 'contractInfo'
      },
      {
        label: '已盖章存档日期',
        type: 'dateTime',
        key: 'stampArchivesDate',
        module: 'contractInfo'
      }
    ], [
      {
        label: '业务类型',
        type: 'input',
        key: 'businessTypeName',
        module: 'contractInfo',
        placeholder: '请输入业务类型',
        maxlength: 64
      },
      {
        label: '部门',
        type: 'input',
        key: 'post',
        module: 'contractInfo',
        placeholder: '请输入部门',
        maxlength: 64
      },
      {
        label: '经手人',
        type: 'input',
        key: 'particularJob',
        module: 'contractInfo',
        placeholder: '请输入经手人',
        maxlength: 64
      }
    ], [{
      label: '备注',
      type: 'input',
      key: 'otherDec',
      module: 'contractInfo',
      maxlength: 200,
      placeholder: '请输入备注内容',
      isFlexStart: true
    }], [{
      label: '合同附件',
      type: 'fileUpload',
      key: 'attachment',
      module: 'contractInfo',
      importApi: '/admin/contract/file/upload',
      btnTxt: '上传附件',
      limitFileNum: 10,
      hidePanel: true
    }]]
  }];
};
